#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
using namespace std;
/*
    这道题目非常的简单，使用优先队列可以秒杀！！
    std::priority_queue<int>
*/
// 创建大堆
priority_queue<int, vector<int>, less<int>> pqu;
int n, k;
using ll = long long;
ll a[(int)(1e5+10)];
ll sum = 0;
int main()
{
    cin >> n >> k;
    for (int i = 1; i <= n; i++)
    {
        int x; cin >> x;
        sum += x;
        if (x % 2 == 0)
        pqu.emplace(x);
    }
    while (k--)
    {
        auto x = pqu.top();
        pqu.pop();
        sum -= x / 2;
        if ((x / 2) % 2 == 0) pqu.emplace(x / 2);
    }

    cout << sum << endl;
    return 0;
}